{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ab2e7c94",
   "metadata": {},
   "source": [
    "# 1. 定义问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "6b9279d0",
   "metadata": {},
   "outputs": [],
   "source": [
    "demo_func = lambda x: x[0] ** 2 + (x[1] - 0.05) ** 2 + x[2] ** 2"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2b21a195",
   "metadata": {},
   "source": [
    "# 2. 运行模拟退火算法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "29c00791",
   "metadata": {},
   "outputs": [],
   "source": [
    "# %% Do SA\n",
    "from sko.SA import SA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "0031bb56",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "best_x: [-6.64964713e-06  5.00030282e-02 -5.46002163e-06] best_y 8.319976555700256e-11\n"
     ]
    }
   ],
   "source": [
    "sa = SA(func=demo_func, x0=[1, 1, 1], T_max=1, T_min=1e-9, L=300, max_stay_counter=150)\n",
    "best_x, best_y = sa.run()\n",
    "print('best_x:', best_x, 'best_y', best_y)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "769c5225-c428-40ec-8525-aec730c357d7",
   "metadata": {},
   "source": [
    "# 3.展示结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "0caf1521-89e3-4855-b3cc-02b31d4cd434",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGdCAYAAADAAnMpAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8ekN5oAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAliklEQVR4nO3dDXRU5b3v8f9kkkxASQCBJIQA8YBBQAPymngUrBEuUgptby+H23OgVu3FggvEu7qMS0Fd557Y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CwPtYWVmpR9VwH+uHPasgoroXtm3bpu9XIPUZjImJaXL/1NBf1UfN/buY+hmtrq7mvl3Crbfeqru4VKtS4zZ69Ghd/9D4nPvXOmfPnpXPPvtMT13A5y7MLJdau3atHvWxevVq6+OPP7Z+85vfWN27d7dKS0tNX5rjKvIPHDigN/VxeeKJJ/TzkydP6vcff/xxfd82bdpkffTRR9b06dOttLQ069y5c5bb3XPPPVZCQoK1fft2q6SkxL999913/mPmzp1r9e/f39q2bZtVWFhoZWZm6s3tHnjgAT3q6MSJE/pzpV57PB7rnXfe0e9z39omcDSNwv0L7v7779c/r+pz9/7771vZ2dlWr1699Eg4hfsWPq4NI8qf/vQn/cGKjY3VQ3337Nlj+pIc57333tMhpPk2Z84c//Dehx9+2EpMTNTh7tZbb7WOHTtm+rIdIdh9U9vzzz/vP0aFtt/+9rd62GrXrl2tn/70pzqwuN2vf/1ra8CAAfpns3fv3vpz1RhEFO7b5YUR7l9wM2fOtJKTk/XnLiUlRb8+fvy4/33uW/h41H/C3foCAAAQiitrRgAAgHMQRgAAgFGEEQAAYBRhBAAAGEUYAQAARhFGAACAUYQRAABgFGEEAAAYRRgBAABGEUYAAIBRhBEAAGAUYQQAAIhJ/x/4qGCNc9SRoQAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# %% Plot the result\n",
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd\n",
    "\n",
    "plt.plot(pd.DataFrame(sa.best_y_history).cummin(axis=0))\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9fde8d27-9258-42d8-9d0a-99d3bf69766f",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.21"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
